home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
C64
/
S-Sound and Music
/
(c)s3.d64
/
retuner.c
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2007-02-04
|
2KB
|
73 lines
1 REM *** TUNER & NOTE TABLE ***
2 REM *** THIS PROGRAM GIVES THE HIGH
3 REM *** & LOW POKES FOR THE CHROMA-
4 REM *** TIC SCALE IF YOU WANT TO TUNE
5 REM *** YOUR C-64 HIGHER OR LOWER
6 REM *** THAN YOUR MANUAL SUGGESTS.
7 REM *** COPYRIGHT JOHN BATCHELOR
8 REM *** TRELAWNY SOFTWARE
9 REM *** NOT FOR SALE
15 POKE53281,15:POKE53280,6:POKE646,0
20 SB=54272
25 H=28:L=214
30 POKESB+5,96:POKESB+6,240:POKESB+24,15
39 PRINTCHR$(14)
40 PRINT"[147][212]UNING NOTE IS [193]."
50 PRINT"[208]RESS [211][146] TO HEAR NOTE."
60 PRINT"[208]RESS [210][146] TO RAISE NOTE."
70 PRINT"[208]RESS [204][146] TO LOWER NOTE."
80 PRINT"[208]RESS [212][146] FOR NOTE TABLE ON SCREEN."
90 PRINT"[208]RESS [208][146] FOR NOTE TABLE ON PRINTER."
100 PRINT"[208]RESS [209][146] TO QUIT."
110 POKE198,0:KY=PEEK(203)
115 IFKY=62THENPRINT"[147]":END:END
120 IFKY=13THEN200
125 IFKY=17THEN300
130 IFKY=42THEN400
135 IFKY=22THEN500
140 IFKY=41THEN600
150 GOTO110
200 REM***PLAY NOTE UNTIL S IS RELEASED
210 POKESB+1,H:POKESB,L
220 POKESB+4,17
230 IFPEEK(203)<>13THENPOKESB+4,16:GOTO110
240 GOTO230
300 REM***RAISE NOTE
310 L=L+1
320 IFL>=256THENL=0:H=H+1:IFH>255THENH=0
330 POKESB+1,H:POKESB,L
340 POKESB+4,17
350 IFPEEK(203)<>17THENPOKESB+4,16:GOTO110
360 GOTO310
400 REM***LOWER NOTE
410 L=L-1
420 IFL<=0THENL=255:H=H-1:IFH<0THENH=255
430 POKESB+1,H:POKESB,L
440 POKESB+4,17
450 IFPEEK(203)<>42THENPOKESB+4,16:GOTO110
460 GOTO410
500 REM***NOTE TABLE ON SCREEN
501 P=0
505 PRINT"[147]";CHR$(142)
508 XX=2^(1/12)
510 S$="#":LL$="AABCCDDEFFGGAABCCDDEFFGGAABCCDDEFFGGAABC"
515 AF=(256*H+L)/4 :LS$="0100101001010100101001010100101001010100"
520 PRINT"STARTS AT A IN BASS CLEF"
530 PRINT"GOES TO C ABOVE TREBLE CLEF"
535 FORJ=1TO20
540 CF=AF*XX^(J*2-2):C2=CF*XX
545 CA=INT(CF/256):CB=INT(CF-CA*256+.5):CC=INT(C2/256):CD=INT(C2-CC*256+.5)
550 D1$=MID$(LL$,J*2-1,1):D2$=" ":IFMID$(LS$,J*2-1,1)="1"THEND2$=S$
560 D3$=MID$(LL$,J*2,1):D4$=" ":IFMID$(LS$,J*2,1)="1"THEND4$=S$
570 PRINTD1$;D2$;CA;CB;TAB(20);D3$;D4$;CC;CD
580 NEXTJ
585 POKE198,0
586 IFP=1THENPRINT#4:CLOSE4
590 PRINT"PRESS ANY KEY TO RE-DO"
595 GETQ$:IFQ$=""THEN595
596 GOTO39
600 REM***NOTE TABLE ON PRINTER
610 P=1
620 OPEN4,4:CMD4
630 GOTO508